<?php /* Smarty version Smarty-3.1.18, created on 2020-05-13 15:08:21
         compiled from "/data/www/mystery/protected/modules/webadmin/views/network/attach.tpl" */ ?>
<?php /*%%SmartyHeaderCode:2023423246553e3481ec2167-56595355%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '141f421894a8fac57c6c3810b48e8fd2008dd6ac' => 
    array (
      0 => '/data/www/mystery/protected/modules/webadmin/views/network/attach.tpl',
      1 => 1494904922,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '2023423246553e3481ec2167-56595355',
  'function' => 
  array (
  ),
  'version' => 'Smarty-3.1.18',
  'unifunc' => 'content_553e3481f12bd5_51798898',
  'variables' => 
  array (
    'list' => 0,
    'val' => 0,
    'page' => 0,
    'network_id' => 0,
  ),
  'has_nocache_code' => false,
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_553e3481f12bd5_51798898')) {function content_553e3481f12bd5_51798898($_smarty_tpl) {?><?php if (!is_callable('smarty_modifier_date_format')) include '/data/www/mystery/protected/extensions/Smarty/plugins/modifier.date_format.php';
?><?php echo $_smarty_tpl->getSubTemplate ("../common/iframe_header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>

<link href="/css/uploadify.css" rel="stylesheet">
<div class="pad_10" style="margin-top: 40px;">
    <div class="table-list">
        <div class="common-form">
            <input type="file" name="upfile" id="uploadify"/>
            <div>请选择ZIP,RAR文件包</div>
        </form>
        </div>
    </div>
    <br/>
    <div class="table-list">
        <table width="100%">
        <thead>
            <tr>
                    <th>ZIP文件名</th>
                    <th>上传时间</th>
                    <th>操作</th>
            </tr>
        </thead>
        <tbody>
            <?php  $_smarty_tpl->tpl_vars['val'] = new Smarty_Variable; $_smarty_tpl->tpl_vars['val']->_loop = false;
 $_smarty_tpl->tpl_vars['key'] = new Smarty_Variable;
 $_from = $_smarty_tpl->tpl_vars['list']->value; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array');}
foreach ($_from as $_smarty_tpl->tpl_vars['val']->key => $_smarty_tpl->tpl_vars['val']->value) {
$_smarty_tpl->tpl_vars['val']->_loop = true;
 $_smarty_tpl->tpl_vars['key']->value = $_smarty_tpl->tpl_vars['val']->key;
?>
            <tr onMouseOver="this.className = 'tr2'" onMouseOut="this.className = 'tr1'" class="tr1" id="question_<?php echo $_smarty_tpl->tpl_vars['val']->value['network_id'];?>
">
                    <td><?php echo $_smarty_tpl->tpl_vars['val']->value['zip_name'];?>
</td>
                    <td><?php echo smarty_modifier_date_format($_smarty_tpl->tpl_vars['val']->value['create_time'],'%Y-%m-%d');?>
</td>
                    <td><a onclick="del(<?php echo $_smarty_tpl->tpl_vars['val']->value['na_id'];?>
)">删除</a></td>
            </tr>
            <?php } ?>
        </tbody>
        </table>

        <div style="float:right;"><?php echo $_smarty_tpl->tpl_vars['page']->value;?>
</div>
    </DIV>
</div>

   
<script src="/js/jquery.uploadify.min.js"></script>
<script type="text/javascript">
    $('#uploadify').uploadify({
        //'debug': true,
        'formData'      : {'network_id' : '<?php echo $_smarty_tpl->tpl_vars['network_id']->value;?>
'},
        'buttonText' : '请选择ZIP文件',
        'fileObjName' : 'upfile',   
        'swf'      : '/js/uploadify.swf',
        'fileTypeExts' : '*.zip;*.rar',
        'uploader' : '/webadmin/attach/NetworkZip',
        'onUploadSuccess' : function(file, data, response) {
            var obj = eval('(' + data + ')');
            if (obj.state =='SUCCESS'){
                alert('上传成功');
                window.location.reload();
            } else {
                alert(obj.error);
            }
        } 
    });
    //删除附件
    function del(na_id){
        if (confirm('确定删除此附件？')) {
            $.getJSON('/webadmin/network/DelAttach',{na_id:na_id},function(res){
                alert(res.note);
                if (res.status == 1) {
                    window.location.reload();
                }
            });
        }
    }
</script>
<?php echo $_smarty_tpl->getSubTemplate ("../common/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
<?php }} ?>
